#include <iostream>
#define N 100

using namespace std;

int oddDigits(int number){
int array;
while(number>0){
    array=number%10;
    if(array%2==0)
        return 0;
    else
        number /= 10;
    }
return 1;
}

int oddSum(int array[], int elements){
int i, sum=0;
for (i=0;i<elements;i++)
    if(oddDigits(array[i]))
        sum += array[i];
return sum;
}

void readintVector(int array[], int elements){
for (int i=0; i<elements; i++){
	cout<<"a["<<i<<"]=";
	cin>>array[i];
	cout<<"\n";}
}



int main(){
int sum;
int array[N];
int elements;
cout<<"Type the number of elements you want in the array: ";
cin>>elements;

readintVector(array, elements);

cout<<"The original array is ";
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
cout<<endl;

sum=oddSum(array, elements);

cout<<"The sum of the odd numbers is: "<< sum << endl;

return 0;
}
